#!/usr/bin/python3
# -*- coding: utf-8 -*-



import rospy
from tf.msg import tfMessage
import time
from sensor_msgs.msg import MultiEchoLaserScan

pub = rospy.Publisher('/horizontal_laser_2d', MultiEchoLaserScan, queue_size=1)
val = MultiEchoLaserScan()

if_print = True


def callback(data):
  val = data
  global if_print
  if if_print:
    print("type: ", type(data.ranges))
    print("header: ", data.header)
    print("len of data's ranges: ", len(data.ranges))
    print("type of data's ranges[0]: ", type(data.ranges[0]))
    print("data of data's ranges[0]: ", data.ranges[0])
    print("data of data's ranges[0]: ", data.ranges[0].echoes)
    # print(data)
    if_print = False
  exit()

def main():
  rospy.init_node('change_bag_imu')
  rospy.Subscriber('/horizontal_laser_2d', MultiEchoLaserScan, callback)
  rospy.spin()

if __name__ == '__main__':
  main()
